import React, { Component } from 'react'

import styled from 'styled-components';

import getIcon from '@/components/MyIcon';
import { Icon, Switch } from 'antd';
export const Headers = styled.section`
background: #D6ECFD;
height: 40px;
line-height: 40px;
text-align: start;
padding: 0 25px;
margin-bottom: 30px;
color: #000;
font-size: 16px;
border-bottom: 1px solid #AEC7D9;
`
const FormDivider = (icon?, title?, isShow?, switchOnChange?, ChildC?) => {
  class Item extends Component {
    render() {
      return (
        <>
        <Headers>
          {icon && getIcon(icon)}
          {title && <span> {title} </span>}
          <Switch style={{ marginLeft: 20 }} checked={isShow} onChange={switchOnChange} />
        </Headers>
       {ChildC && <ChildC></ChildC>}
        </>
      )
    }
  }
  return Item;
}
export default FormDivider